From 84dc7809ecb1d14ec928185b4fe50fb7d105b7d5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 17 May 2003 06:06:31 +0000 Subject: [PATCH] Disable page cache option; move RC javascript to wikibits.js; spiffy up timezone prefs a bit --- includes/Skin.php | 20 ++------------------ includes/SpecialPreferences.php | 12 +++++++++--- languages/Language.php | 10 +++++++--- stylesheets/wikibits.js | 15 +++++++++++++++ 4 files changed, 33 insertions(+), 24 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index c8733acc77..eff267a077 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -62,24 +62,8 @@ class Skin { } function getHeadScripts() { - $r = " - - " ; + global $wgStyleSheetPath; + $r = "\n"; return $r; } diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index 082ea94933..531a46df92 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -155,6 +155,8 @@ function wfSpecialPreferences() $ltz = wfMsg( "localtime" ); $tzt = wfMsg( "timezonetext" ); $tzo = wfMsg( "timezoneoffset" ); + $tzGuess = wfMsg( "guesstimezone" ); + $tzServerTime = wfMsg( "servertime" ); $yem = wfMsg( "youremail" ); $emf = wfMsg( "emailflag" ); $ynn = wfMsg( "yournick" ); @@ -165,7 +167,7 @@ function wfSpecialPreferences() $scc = wfMsg( "contextchars" ); $rcc = wfMsg( "recentchangescount" ); - $wgOut->addHTML( "
addHTML( "" ); # Email, etc. diff --git a/languages/Language.php b/languages/Language.php index 179b1fc561..8bbbf5ba44 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -24,7 +24,8 @@ "cols" => 80, "rows" => 25, "searchlimit" => 20, "contextlines" => 5, "contextchars" => 50, "skin" => 0, "math" => 1, "rcdays" => 7, "rclimit" => 50, - "highlightbroken" => 1, "stubthreshold" => 0 + "highlightbroken" => 1, "stubthreshold" => 0, + "previewontop" => 1 ); /* private */ $wgQuickbarSettingsEn = array( @@ -57,7 +58,8 @@ this (alternative: like this?).", "editondblclick" => "Edit pages on double click (JavaScript)", "watchdefault" => "Watch new and modified articles", "minordefault" => "Mark all edits minor by default", - "previewontop" => "Show preview before edit box and not after it" + "previewontop" => "Show preview before edit box and not after it", + "nocache" => "Disable page caching" ); /* private */ $wgBookstoreListEn = array( @@ -620,8 +622,10 @@ Your internal ID number is $2.", "savedprefs" => "Your preferences have been saved.", "timezonetext" => "Enter number of hours your local time differs from server time (UTC).", -"localtime" => "Local time", +"localtime" => "Local time display", "timezoneoffset" => "Offset", +"servertime" => "Server time is now", +"guesstimezone" => "Fill in from browser", "emailflag" => "Disable e-mail from other users", # Recent changes diff --git a/stylesheets/wikibits.js b/stylesheets/wikibits.js index 8886e119da..c2b37a8a18 100644 --- a/stylesheets/wikibits.js +++ b/stylesheets/wikibits.js @@ -30,3 +30,18 @@ function checkTimezone( tz, msg ) { document.write( junk[0] + "UTC" + tzString + junk[1] ); } } + +// in [-][H]H format... +// won't yet work with non-even tzs +function fetchTimezone() { + var localclock = new Date(); + // returns negative offset from GMT in minutes + var tzRaw = localclock.getTimezoneOffset(); + var tzHour = Math.floor( Math.abs(tzRaw) / 60); + var tzString = ((tzRaw >= 0) ? "-" : "") + ((tzHour < 10) ? "" : "0") + tzHour; + return tzString; +} + +function guessTimezone(box) { + document.preferences.wpHourDiff.value = fetchTimezone(); +} -- 2.20.1
$qb:
\n" ); # Quickbar setting @@ -227,11 +229,15 @@ value=\"$i\"$checked> {$mathopts[$i]}
\n" ); # Textbox rows, cols # + $nowlocal = $wgLang->time( $now = wfTimestampNow(), true ); + $nowserver = $wgLang->time( $now, false ); $wgOut->addHTML( "
$tbs:
$tbr:
$tbc:

-$ltz
-$tzo*: +$tzServerTime: $nowserver
+$ltz: $nowlocal
+$tzo*:
+